
<%= text_f f, :name, :label => _('Name'), :label_size => "col-md-2", :disabled => !new_vm if show_vm_name? %>
<div id="cpus_input">
  <%= counter_f(f, :cpus, label: _('CPUs'), disabled: !new_vm, recommended_max_value: compute_resource.max_cpu_count) %>
</div>
<%= byte_size_f(f, :memory, disabled: !new_vm, label: _('Memory'), recommended_max_value: compute_resource.max_memory.to_i) %>
<!--TODO # Move to a helper-->
<% checked = params[:host] && params[:host][:compute_attributes] && params[:host][:compute_attributes][:start] || '1' %>
<%= checkbox_f f, :start, { :checked => (checked == '1'), :help_inline => _("Power ON this machine"), :label => _('Start'), :label_size => "col-md-2"} if new_vm && controller_name != "compute_attributes" %>

<%
  firmware_type = compute_resource.firmware_type(f.object.firmware, f.object.secure_boot)
%>
<%= field(f, :firmware, :disabled => !new_vm, :label => _('Firmware'), :label_help => _("Choose 'Automatic' to set the firmware based on the PXE loader of the host. If no PXE loader is selected, firmware defaults to BIOS."), :label_size => "col-md-2") do
  compute_resource.firmware_types.collect do |type, name|
    radio_button_f f, :firmware, {:checked => (firmware_type == type), :disabled => !new_vm, :value => type, :text => _(name) }
  end.join(' ').html_safe
end %>

<%
   arch ||= nil ; os ||= nil
   images = possible_images(compute_resource, arch, os)
-%>
<div id='image_selection'>
  <%= select_f f, :image_id, images, :uuid, :name,{:include_blank => (images.empty? || images.size == 1) ? false : _('Please select an image')},
             { :disabled    => images.empty? || (params[:host] && params[:host][:provision_method] == 'build'),
               :'data-url'  => template_selected_compute_resource_path(compute_resource),
               :onchange    => 'tfm.computeResource.libvirt.imageSelected(this);',
               :label => _('Image'), :label_size => "col-md-2"} %>
</div>

<%= compute_specific_js(compute_resource, "nic_info") %>
